Where
Code - A URL of applet class.
Height - Height to display the applet.
width - Width to display the applet.
al - Alternate text to be displayed in case browser does not support applet.
Param tag is used to pass additional parameters to applet
Life cycle methods for Applet
When Browser finds Applet tag in webpage.
It downloads the specified Applet class.
It loads the Applet class.
It creates Object of Applet Class.
It calls its different methods on different events
There are 5 main events in life of Applet
init
start
paint
stop
destroy
According to these event applet container call its 5 different methods.
public void init()
Is used to initialized the Applet.
It is invoked only once.
public void start()
Is invoked when Applet scrolls into View or Restored.
It is used to start the Applet.
public void stop()
Is used to stop the Applet.
It is invoked when Applet scrolls out of view or browser is minimized.
public void destroy()
Is used to destroy the Applet.
It is invoked only once.
public void paint(Graphics g)
is used to paint the Applet. It provides Graphics class object that can be used for drawing oval, rectangle, arc etc.